using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter39
{
	/// <summary>
	/// Example07: Relative velocity of Two Spacecraft
	/// Two spacecraft A and B are moving in opposite directions, 
	/// as shown in Figure 39.15. An observer on the Earth measures 
	/// the speed of craft A to be 0.750c and the speed of craft B 
	/// to be 0.850c. Find the velocity of craft B as observed by 
	/// the crew on craft A. 
	/// </summary>
	public class Example07
	{
		public Example07()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Velocity v = new L.Velocity();
			v.X = 0.75*L.Constant.SpeedOfLightInVacuum;
			L.Velocity u = new L.Velocity();
			u.X = -0.85*L.Constant.SpeedOfLightInVacuum;
			L.Velocity up = new L.Velocity();
			L.Relativity.LorentzTransformationForVelocity(u,up,v);
			result+=Convert.ToString(up.X/L.Constant.SpeedOfLightInVacuum)+"\r\n";  
		}
	}
}
